package SV_PRIVILEGE_MISSING;


import java.lang.reflect.Field;
import java.security.AccessController;
import java.security.PrivilegedAction;

public class Vulnerable_02 {
    private static Field field;
    void test() {
        AccessController.doPrivileged(new PrivilegedAction() {
            @Override
            public Object run() {
                field.setAccessible(true);  // <----- SV.PRIVILEGE.MISSING should not be in doPrivileged block
                return null;
            }
        });

        AccessController.doPrivileged((PrivilegedAction) () -> {
            field.setAccessible(true);  // <----- SV.PRIVILEGE.MISSING should not be in doPrivileged block
            return null;
        });
    }
}
